<div class="header">
  <ul class="nav nav-pills pull-right">
    <li class="active"><a ng-href="#">Home</a></li>
  </ul>
  <h3 class="text-muted">web_app</h3>
</div>

<div ng-controller="MainCtrl">
  <table class="table table-bordered table-hover table-condensed">
    <tr style="font-weight: bold">
      <td style="width:40%">标题</td>
      <td style="width:40%">正文</td>
      <td style="width:20%">操作</td>
    </tr>
    <tr ng-repeat="post in posts">
      <td>
        <!-- editable title -->
        <span editable-text="post.title" e-name="title" e-form="rowform"  e-required>
          {{ post.title || 'empty'  }}
        </span>
      </td>
      <td>
        <!-- editable content) -->
        <span editable-text="post.content" e-name="content" e-form="rowform" e-required>
          {{ post.content || 'empty' }}
        </span>
      </td>
      <td style="white-space: nowrap">
        <!-- form -->
        <form editable-form name="rowform"  ng-show="rowform.$visible" class="form-buttons form-inline" shown="post.id == null" onbeforesave="savePost($data, post.id, $index)">
          <button type="submit" ng-disabled="rowform.$waiting" class="btn btn-primary" >
            save
          </button>
          <button type="button" ng-disabled="rowform.$waiting" ng-click="rowform.$cancel()" class="btn btn-default">
            cancel
          </button>
        </form>
        <div class="buttons" ng-show="!rowform.$visible">
          <button class="btn btn-primary" ng-click="rowform.$show()">edit</button>
          <button class="btn btn-danger" ng-confirm-click="removePost($index)">del</button>
        </div>  
      </td>
    </tr>
  </table>

  <button class="btn btn-default" ng-click="addPost()">Add row</button>
</div>

<br/>

<div class="footer">
  <p>♥ from the Yeoman team</p>
</div>
